package com.skytech.tax.customsdatawarehouse.singlewindow.processtrade.manual.domain.entity;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.springframework.beans.factory.support.ManagedArray;

/**
 * @author Lianhong
 * @since 2021/11/11
 */
public class Manual {

    private String seqNo;

    private String manual;

    private String socialCreditCode;

    private String inputTime;
    private String storageTime;

    public String getSeqNo() {
        return seqNo;
    }

    public void setSeqNo(String seqNo) {
        this.seqNo = seqNo;
    }

    public String getManual() {
        return manual;
    }

    public void setManual(String manual) {
        this.manual = manual;
    }

    public String getSocialCreditCode() {
        return socialCreditCode;
    }

    public void setSocialCreditCode(String socialCreditCode) {
        this.socialCreditCode = socialCreditCode;
    }

    public String getInputTime() {
        return inputTime;
    }

    public void setInputTime(String inputTime) {
        this.inputTime = inputTime;
    }

    public String getStorageTime() {
        return storageTime;
    }

    public void setStorageTime(String storageTime) {
        this.storageTime = storageTime;
    }

    public ManualSimple buildManualSimple() {
        ManualSimple simple = new ManualSimple();
        simple.setSeqNo(seqNo);
        return simple;
    }

    public void addFields() {
        JSONObject manual = JSON.parseObject(this.manual);
        JSONObject nptsEmlHead = manual.getJSONObject("nptsEmlHead");
        this.inputTime = nptsEmlHead.getString("inputTime");
    }
}
